Skip to content

Feat/contract fix#85

Merged
MeongW merged 7 commits intodevelopfrom
feat/contract_fix
Aug 13, 2025
Merged

Feat/contract fix#85
MeongW merged 7 commits intodevelopfrom
feat/contract_fix

Conversation

@MeongW
Copy link
Contributor

@MeongW MeongW commented Aug 13, 2025

🚀 관련 이슈

🔑 주요 변경사항

✔️ 체크 리스트

  • Merge 하려는 브랜치가 올바른가? (main branch에 실수로 PR 생성 금지)
  • Merge 하려는 PR 및 Commit들을 로컬에서 실행했을 때 에러가 발생하지 않았는가?
  • 라벨을 등록했는가?
  • 리뷰어를 지정했는가?

📢 To Reviewers

📸 스크린샷 or 실행영상

↗️ 개선 사항

Summary by CodeRabbit

  • New Features
    • 정보 조회 시작·다음 단계 안내 메시지가 개선되어 진행 흐름이 더 명확합니다.
    • 보증금 조율 단계에 대한 단계 전환 및 알림 메시지가 추가되었습니다.
  • Bug Fixes
    • 임대인/임차인 식별 및 권한 검증을 강화해 잘못된 접근을 방지합니다.
    • 본인인증 정보를 기반으로 계약서의 이름/주소 표기 정확도를 개선했습니다.
  • Chores
    • 대기(stand-by) 단계 기능을 제거해 진행 흐름을 단순화했습니다.
    • 기능 라벨을 표준화해 화면 내 표기 일관성을 높였습니다.

@coderabbitai
Copy link

coderabbitai bot commented Aug 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

계약 대기 API 제거, 계약 단계 및 메시징 흐름 재구성, Redis 기반 nextSteps 합의 로직 도입, 사용자 검증(임대인/임차인) 강화, ContractMapper에 소유자/임차인 조회 추가 및 identity_verification 조인으로 계약 조회 변경, 사전계약 서비스/구현체를 Tenant*로 리네이밍, STEP0 상태 업데이트 추가.

Changes

Cohort / File(s) Summary
Contract Controller API 정리
src/main/java/.../contract/controller/ContractController.java, .../ContractControllerImpl.java
standByContract 엔드포인트/시그니처 제거. ApiOperation 설명 문구 표준화(대괄호 식별자).
Contract Service 리팩터링/흐름 변경
src/main/java/.../contract/service/ContractService.java, .../ContractServiceImpl.java
서비스 인터페이스에서 standByContract 제거. 구현체에서 대기 흐름 제거, getContract 사전 메시지/자동 단계 업데이트 제거, getContractNext 시작 메시지 추가, nextStep → nextSteps(Redis 합의) 도입 및 단계 전환/메시지 재구성, 사용자 검증 로직(임대인/임차인) 확장, 보증금 단계 메시지/전환 조정.
Contract Mapper 확장/SQL 변경
src/main/java/.../contract/mapper/ContractMapper.java, src/main/resources/.../contract/mapper/ContractMapper.xml
getOwnerId/getBuyerId 메서드 추가. 계약 조회에서 user 조인 제거, identity_verification 조인으로 이름/주소 소스 변경.
사전계약(임차인) 서비스 리네이밍
src/main/java/.../precontract/service/TenantPreContractService.java, .../TenantPreContractServiceImpl.java, .../precontract/controller/TenantPreContractControllerImpl.java
PreContractService → TenantPreContractService로 인터페이스/구현체/컨트롤러 의존성 명칭 변경(동작 동일).
사전계약(임대인) 저장 시 상태 업데이트
src/main/java/.../precontract/service/OwnerPreContractServiceImpl.java
Mongo 저장 후 계약채팅 상태 STEP0로 업데이트 추가.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ContractController
  participant ContractService
  participant Redis
  participant ChatService

  Client->>ContractController: POST /contract/{id}/nextStep
  ContractController->>ContractService: nextStep(id, userId, dto)
  ContractService->>Redis: HGET/HSET readiness (owner/buyer)
  Redis-->>ContractService: readiness state
  alt both ready
    ContractService->>ChatService: AI message: 다음 단계 안내/금액 조율 안내
    ContractService-->>ContractController: true
  else waiting
    ContractService-->>ContractController: false
  end
  ContractController-->>Client: {ready: true|false}
Loading
sequenceDiagram
  participant Client
  participant ContractController
  participant ContractService
  participant Mapper
  participant ChatService

  Client->>ContractController: GET /contract/{id}/next
  ContractController->>ContractService: getContractNext(id, userId)
  ContractService->>Mapper: getOwnerId/getBuyerId + 계약 정보
  Mapper-->>ContractService: IDs/계약 DTO
  ContractService->>ChatService: AI message: 정보조회 시작
  ContractService->>ChatService: AiMessageBtn: 다음 단계 안내
  ContractService-->>ContractController: DTO
  ContractController-->>Client: DTO
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
계약 전 채팅 로직 구현, API 구현 (#1)
채팅 리스트 API 구현 (#1) 리스트 API 관련 변경이 보이지 않음.
SSE 기반 채팅 알림 구현 (#1) SSE 추가/엔드포인트/구독 처리 없음.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
PreContractService → TenantPreContractService로 인터페이스/구현체/컨트롤러 의존성 리네이밍 (src/main/java/.../precontract/service/TenantPreContractService.java, .../TenantPreContractServiceImpl.java, .../precontract/controller/TenantPreContractControllerImpl.java) 링크된 이슈는 채팅 모듈에 관한 것으로, 임차인 사전계약 서비스 명칭 변경은 직접적 요구사항에 포함되지 않음.
ContractMapper.getContract에서 identity_verification 조인으로 변경 (src/main/resources/.../contract/mapper/ContractMapper.xml) 신원확인 데이터 소스로의 전환은 명시된 채팅 모듈 범위를 넘어설 수 있음. 채팅 기능 요구사항에 직접 연결되지 않음.

Possibly related PRs

Suggested labels

✨ feature, ♻️ refactor

Suggested reviewers

  • Whatdoyumin

Poem

토끼는 채팅방에 펄쩍, STEP0로 둥실 출발
대기는 안녕—레디스에 찰칵 기록
임대인·임차인 둘 다 OK면 다음으로 쏙
이름은 신원확인서에서 톡톡
당근 같은 버튼 눌러, 계약 길 hop-hop!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de2175f and afe7ff2.

📒 Files selected for processing (10)
  • src/main/java/org/scoula/domain/contract/controller/ContractController.java (1 hunks)
  • src/main/java/org/scoula/domain/contract/controller/ContractControllerImpl.java (0 hunks)
  • src/main/java/org/scoula/domain/contract/mapper/ContractMapper.java (1 hunks)
  • src/main/java/org/scoula/domain/contract/service/ContractService.java (0 hunks)
  • src/main/java/org/scoula/domain/contract/service/ContractServiceImpl.java (7 hunks)
  • src/main/java/org/scoula/domain/precontract/controller/TenantPreContractControllerImpl.java (2 hunks)
  • src/main/java/org/scoula/domain/precontract/service/OwnerPreContractServiceImpl.java (1 hunks)
  • src/main/java/org/scoula/domain/precontract/service/TenantPreContractService.java (1 hunks)
  • src/main/java/org/scoula/domain/precontract/service/TenantPreContractServiceImpl.java (1 hunks)
  • src/main/resources/org/scoula/domain/contract/mapper/ContractMapper.xml (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/contract_fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@MeongW MeongW merged commit edef9df into develop Aug 13, 2025
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 이슈 제목

2 participants